﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
public partial class CompHonor : System.Web.UI.Page
{
    AccessDAO dao = new AccessDAO();
    AccessConn con = new AccessConn();
    DataSet ds;
    OleDbCommand comm;
    OleDbConnection conn;
    OleDbDataAdapter da;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string name = Request.QueryString["title"].ToString();
            string ss = "select count(*) from rxInfo,rxMessage where rxInfo.id=rxMessage.typeId and rxInfo.name='" + name + "'";
            conn = con.getConn();
            try
            {
                conn.Open();

                comm = new OleDbCommand(ss, conn);
                this.AspNetPager1.AlwaysShow = true;
                this.AspNetPager1.PageSize = 9;
                this.AspNetPager1.RecordCount = (int)comm.ExecuteScalar();
                conn.Close();
            }
            catch
            { }
            show();


            string s2 = "select * from billInfo where id=1";
            DataSet ds2 = dao.getDs(s2);
            this.dlProdu.DataSource = ds2;
            this.dlProdu.DataBind();
        }
    }
    private void show()
    {
        ds = new DataSet();
        conn = con.getConn();
        string name = Request.QueryString["title"].ToString();

        string ss = "select rxMessage.id as id,rxMessage.picture,rxMessage.name from rxInfo,rxMessage where rxInfo.id=rxMessage.typeId and rxInfo.name='" + name + "' order by rxMessage.id desc";

        try
        {
            conn.Open();
            da = new OleDbDataAdapter(ss, conn);
            da.Fill(ds, (this.AspNetPager1.CurrentPageIndex - 1) * this.AspNetPager1.PageSize, this.AspNetPager1.PageSize, "Page");
            this.dlRy.DataSource = ds;
            this.dlRy.DataBind();
            conn.Close();
        }
        catch
        { }
    }

    protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        this.AspNetPager1.CurrentPageIndex = e.NewPageIndex;
        show();
    }
}


